home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 141 / cdrom141.iso / aplic / ageletr / setup.exe / {code_GetDataFolder} / Templates / default.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2007-02-25  |  3.3 KB  |  116 lines

  1. ∩╗┐<?xml version="1.0" encoding="UTF-8"?>
  2. <!--For basic HTML rendering of QuickView
  3. -->
  4. <xsl:stylesheet version="1.0"
  5. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  6. <xsl:output method="xml" omit-xml-declaration="yes" encoding="UTF-8" />
  7.  
  8.   <xsl:template match="/">
  9.     <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  12. </head>
  13.  
  14.       <body>
  15.         <xsl:for-each select="OpenContacts/Contacts/Contact">
  16.  
  17.           <table border="0" width="100%" id="table2">
  18.             <tr>
  19.               <td width="80%">
  20.                 <font face="Times New Roman" size="3">
  21.                   <b>
  22.                     <xsl:value-of select="@Name"/>
  23.                   </b>
  24.                 </font>
  25.               </td>
  26.               <td>
  27.                 <xsl:value-of select="@Title"/>
  28.               </td>
  29.             </tr>
  30.           </table>
  31.           <div style="margin-left: 15px;">
  32.  
  33.             <font size="2" color="#800000">
  34.                 <xsl:apply-templates select="Notes"/>
  35.             </font>
  36.  
  37.  
  38.           </div>
  39.           <xsl:for-each select="Sections/Section">
  40.             <div style="margin-left: 15px;">
  41.  
  42.  
  43.               <b>
  44.                 <font face="Times New Roman" size="2">
  45.                   <xsl:value-of select="@Name"/>
  46.                 </font>
  47.               </b>
  48.             </div>
  49.  
  50.  
  51.  
  52.             <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
  53.               <xsl:for-each select="Fields/Field">
  54.                 <tr>
  55.                   <td width="15"></td>
  56.                   <td width="80" bgcolor="#C3D9FF">
  57.                     <font face="Times New Roman" size="2">
  58.                       <xsl:value-of select="@Name"/>:
  59.                     </font>
  60.                   </td>
  61.                   <td bgcolor="#E0ECFF">
  62.                     <font size="3">
  63.                       <xsl:value-of select="@Value"/>
  64.                     </font>
  65.                   </td>
  66.                 </tr>
  67.               </xsl:for-each>
  68.  
  69.             </table>
  70.  
  71.             <div style="margin-left: 15px;">
  72.  
  73.               <font size="2" color="#800000">
  74.                 <xsl:apply-templates select="Notes"/>
  75.               </font>
  76.  
  77.  
  78.             </div>
  79.  
  80.           </xsl:for-each>
  81.  
  82.           <p>  </p>
  83.         </xsl:for-each>
  84.       </body>
  85.     </html>
  86.   </xsl:template>
  87.  
  88.   <xsl:template match="Notes">
  89.       <xsl:call-template name="substitute">
  90.          <xsl:with-param name="string" select="." />
  91.       </xsl:call-template>
  92. </xsl:template>
  93.  
  94.  <xsl:template name="substitute">
  95.    <xsl:param name="string" />
  96.    <xsl:param name="from" select="' '" />
  97.    <xsl:param name="to">
  98.       <p/>
  99.    </xsl:param>
  100.    <xsl:choose>
  101.       <xsl:when test="contains($string, $from)">
  102.          <xsl:value-of select="substring-before($string, $from)" />
  103.          <xsl:copy-of select="$to" />
  104.          <xsl:call-template name="substitute">
  105.             <xsl:with-param name="string"
  106.                             select="substring-after($string, $from)" />
  107.             <xsl:with-param name="from" select="$from" />
  108.             <xsl:with-param name="to" select="$to" />
  109.          </xsl:call-template>
  110.       </xsl:when>
  111.       <xsl:otherwise>
  112.          <xsl:value-of select="$string" />
  113.       </xsl:otherwise>
  114.    </xsl:choose>
  115. </xsl:template>                
  116. </xsl:stylesheet>